home *** CD-ROM | disk | FTP | other *** search
/ Kit PC World De Ampliacion De Windows 95 / Kit PC World de ampliacion de Windows 95.iso / internet / sweeper / samples / olecon~1 / controls / localize / localize.cpp < prev    next >
Text File  |  1995-11-25  |  6KB  |  206 lines

  1. //=--------------------------------------------------------------------------=
  2. // Localize.Cpp
  3. //=--------------------------------------------------------------------------=
  4. // Copyright  1995  Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // various routines et all that aren't in a file for a particular automation
  13. // object, and don't need to be in the generic ole automation code.
  14. //
  15. #define INITOBJECTS                // define the descriptions for our objects
  16.  
  17. #include "IPServer.H"
  18. #include "LocalSrv.H"
  19.  
  20.  
  21. #include "LocalObj.H"
  22. #include "LocalizeInterfaces.H"
  23. #include "CtrlObj.H"
  24. #include "Globals.H"
  25. #include "Util.H"
  26. #include "Resource.H"
  27.  
  28. #include "LocalizeCtl.H"
  29. #include "LocalizePPG.H"
  30.  
  31. // needed for ASSERTs and FAIL
  32. //
  33. SZTHISFILE
  34.  
  35. //=--------------------------------------------------------------------------=
  36. // our Libid.  This should be the LIBID from the Type library, or NULL if you
  37. // don't have one.
  38. //
  39. const CLSID *g_pLibid = &LIBID_LocalizeObjects;
  40.  
  41.  
  42. //=--------------------------------------------------------------------------=
  43. // Localization Information
  44. //
  45. // We need the following two pieces of information:
  46. //    a. whether or not this DLL uses satellite DLLs for localization.  if
  47. //       not, then the lcidLocale is ignored, and we just always get resources
  48. //       from the server module file.
  49. //    b. the ambient LocaleID for this in-proc server.  Controls calling
  50. //       GetResourceHandle() will set this up automatically, but anybody
  51. //       else will need to be sure that it's set up properly.
  52. //
  53. VARIANT_BOOL    g_fSatelliteLocalization =  TRUE;
  54. LCID            g_lcidLocale = MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT);
  55.  
  56.  
  57. //=--------------------------------------------------------------------------=
  58. // your license key and where under HKEY_CLASSES_ROOT_LICENSES it's sitting
  59. //
  60. WCHAR g_wszLicenseKey [] = L"";
  61. WCHAR g_wszLicenseLocation [] = L"";
  62.  
  63.  
  64. //=--------------------------------------------------------------------------=
  65. // This Table describes all the automatible objects in your automation server.
  66. // See AutomationObject.H for a description of what goes in this structure
  67. // and what it's used for.
  68. //
  69. OBJECTINFO g_ObjectInfo[] = {
  70.     CONTROLOBJECT(Localize),
  71.     PROPERTYPAGE(LocalizeGeneral),
  72.     EMPTYOBJECT
  73. };
  74.  
  75. char g_szLibName[] = "Localize";
  76.  
  77. //=--------------------------------------------------------------------------=
  78. // IntializeLibrary
  79. //=--------------------------------------------------------------------------=
  80. // called from DllMain:DLL_PROCESS_ATTACH.  allows the user to do any sort of
  81. // initialization they want to.
  82. //
  83. // Notes:
  84. //
  85. void InitializeLibrary
  86. (
  87.     void
  88. )
  89. {
  90.     // TODO: initialization here.  control window class should be set up in
  91.     // RegisterClassData.
  92. }
  93.  
  94. //=--------------------------------------------------------------------------=
  95. // UninitializeLibrary
  96. //=--------------------------------------------------------------------------=
  97. // called from DllMain:DLL_PROCESS_DETACH.  allows the user to clean up anything
  98. // they want.
  99. //
  100. // Notes:
  101. //
  102. void UninitializeLibrary
  103. (
  104.     void
  105. )
  106. {
  107.     // TODO: uninitialization here.  control window class will be unregistered
  108.     // for you, but anything else needs to be cleaned up manually.
  109.     // Please Note that the Window 95 DLL_PROCESS_DETACH isn't quite as stable
  110.     // as NT's, and you might crash doing certain things here ...
  111. }
  112.  
  113.  
  114. //=--------------------------------------------------------------------------=
  115. // CheckForLicense
  116. //=--------------------------------------------------------------------------=
  117. // users can implement this if they wish to support Licensing.  otherwise,
  118. // they can just return TRUE all the time.
  119. //
  120. // Parameters:
  121. //    none
  122. //
  123. // Output:
  124. //    BOOL            - TRUE means the license exists, and we can proceed
  125. //                      FALSE means we're not licensed and cannot proceed
  126. //
  127. // Notes:
  128. //    - implementers should use g_wszLicenseKey and g_wszLicenseLocation
  129. //      from the top of this file to define their licensing [the former
  130. //      is necessary, the latter is recommended]
  131. //
  132. BOOL CheckForLicense
  133. (
  134.     void
  135. )
  136. {
  137.     // TODO: decide whether or not your server is licensed in this function.
  138.     // people who don't want to bother with licensing should just return
  139.     // true here always.  g_wszLicenseKey and g_wszLicenseLocation are
  140.     // used by IClassFactory2 to do some of the licensing work.
  141.     //
  142.     return TRUE;
  143. }
  144.  
  145. //=--------------------------------------------------------------------------=
  146. // RegisterData
  147. //=--------------------------------------------------------------------------=
  148. // lets the inproc server writer register any data in addition to that in
  149. // any other objects.
  150. //
  151. // Output:
  152. //    BOOL            - false means failure.
  153. //
  154. // Notes:
  155. //
  156. BOOL RegisterData
  157. (
  158.     void
  159. )
  160. {
  161.     // TODO: register any additional data here that you might wish to.
  162.     //
  163.     return TRUE;
  164. }
  165.  
  166. //=--------------------------------------------------------------------------=
  167. // UnregisterData
  168. //=--------------------------------------------------------------------------=
  169. // inproc server writers should unregister anything they registered in
  170. // RegisterData() here.
  171. //
  172. // Output:
  173. //    BOOL            - false means failure.
  174. //
  175. // Notes:
  176. //
  177. BOOL UnregisterData
  178. (
  179.     void
  180. )
  181. {
  182.     // TODO: any additional registry cleanup that you might wish to do.
  183.     //
  184.     return TRUE;
  185. }
  186.  
  187.  
  188. //=--------------------------------------------------------------------------=
  189. // CRT stubs
  190. //=--------------------------------------------------------------------------=
  191. // these two things are here so the CRTs aren't needed. this is good.
  192. //
  193. // basically, the CRTs define this to suck in a bunch of stuff.  we'll just
  194. // define them here so we don't get an unresolved external.
  195. //
  196. // TODO: if you are going to use the CRTs, then remove this line.
  197. //
  198. extern "C" int __cdecl _fltused = 1;
  199.  
  200. extern "C" int _cdecl _purecall(void)
  201. {
  202.   FAIL("Pure virtual function called.");
  203.   return 0;
  204. }
  205.  
  206.